<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .container {
    position: relative;
    width: 500px;
    height: 500px;
    border: 1px solid #ccc;
  }

  .item {
    width: 100px;
    height: 250px;
    background-color: aqua;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    margin: auto;
  }
</style>

<body>

  <div class="container">
    <div class="item">1231</div>
  </div>
</body>

</html>